import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { CacheModule } from '@nestjs/cache-manager';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { WechatModule } from './wechat/wechat.module';

@Module({
  imports: [
    ConfigModule.forRoot({
      isGlobal: true,
      envFilePath: `.env.${process.env.NODE_ENV || 'development'}`,
    }),
    CacheModule.register({
      isGlobal: true,
      ttl: 7000 * 1000, // 转换为毫秒
      max: 100, // 最大缓存数量
    }),
    WechatModule
  ],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
